﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MoveObj : MonoBehaviour {
    public enum ObjType
    {
        White,Blue,Orange,Yellow,Green,Purple,Red,Black,Init
    }
    public ObjType m_ObjType;
    public List<Vector2> m_PosList = new List<Vector2>();
    
    
	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
       
    }
    public void InitType() {
        m_PosList.Clear();
        int i = Random.Range(0,7);
        m_ObjType = (ObjType)i;
        Vector2 pos1 = new Vector2(0f, 0f);
        Vector2 pos2 = new Vector2(0f, 0f);
        Vector2 pos3 = new Vector2(0f, 0f);
        Vector2 pos4 = new Vector2(0f, 0f);
        switch (m_ObjType) {
            case ObjType.White:
                pos1 = new Vector2(0f, 0f);
                pos2 = new Vector2(0f, 1f);
                pos3 = new Vector2(0f, 2f);
                pos4 = new Vector2(0f, 3f);
                m_PosList.Add(pos1);
                m_PosList.Add(pos2);
                m_PosList.Add(pos3);
                m_PosList.Add(pos4);
                break;
            case ObjType.Blue:
                pos1 = new Vector2(0f, 0f);
                 pos2 = new Vector2(1f, 0f);
                 pos3 = new Vector2(1f, 1f);
                 pos4 = new Vector2(1f, 2f);
                m_PosList.Add(pos1);
                m_PosList.Add(pos2);
                m_PosList.Add(pos3);
                m_PosList.Add(pos4);
                break;
            case ObjType.Orange:
                 pos1 = new Vector2(1f, 0f);
                 pos2 = new Vector2(1f, 1f);
                 pos3 = new Vector2(1f, 2f);
                 pos4 = new Vector2(0f, 2f);
                m_PosList.Add(pos1);
                m_PosList.Add(pos2);
                m_PosList.Add(pos3);
                m_PosList.Add(pos4);
                break;
            case ObjType.Yellow:
                 pos1 = new Vector2(0f, 1f);
                 pos2 = new Vector2(0f, 2f);
                 pos3 = new Vector2(1f, 1f);
                 pos4 = new Vector2(1f, 2f);
                m_PosList.Add(pos1);
                m_PosList.Add(pos2);
                m_PosList.Add(pos3);
                m_PosList.Add(pos4);
                break;
            case ObjType.Green:
                pos1 = new Vector2(1f, 0f);
                pos2 = new Vector2(1f, 1f);
                pos3 = new Vector2(0f, 1f);
                pos4 = new Vector2(0f, 2f);
                m_PosList.Add(pos1);
                m_PosList.Add(pos2);
                m_PosList.Add(pos3);
                m_PosList.Add(pos4);
                break;
            case ObjType.Purple:
                 pos1 = new Vector2(1f, 0f);
                 pos2 = new Vector2(1f, 1f);
                 pos3 = new Vector2(0f, 1f);
                 pos4 = new Vector2(1f, 2f);
                m_PosList.Add(pos1);
                m_PosList.Add(pos2);
                m_PosList.Add(pos3);
                m_PosList.Add(pos4);
                break;
            case ObjType.Red:
                pos1 = new Vector2(0f, 1f);
                pos2 = new Vector2(0f, 2f);
                pos3 = new Vector2(1f, 2f);
                pos4 = new Vector2(1f, 3f);
                m_PosList.Add(pos1);
                m_PosList.Add(pos2);
                m_PosList.Add(pos3);
                m_PosList.Add(pos4);
                break;
        }
        
    }
   
    
}
